package com.cloud.stream.receiver;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;

import com.cloud.stream.Application;
import com.cloud.stream.model.User;

@EnableBinding(value = { Sink.class, SinkSender.class })
public class SinkReceiver {

	private static Logger logger = LoggerFactory.getLogger(Application.class);

	@StreamListener(Sink.INPUT)
	public void receive(User user) {
		logger.info("Receive : " + user.toString());
	}
	
	
	/*
	 * @Transformer(inputChannel = Sink.INPUT, outputChannel = Sink.INPUT)
	 * public User transform(String message) throws Exception { ObjectMapper obj
	 * = new ObjectMapper(); User user = obj.readValue(message, User.class);
	 * return user; }
	 */
}
